# Contributor: Andy Blyler <andy@blyler.cc>
# Maintainer: Fabio Ribeiro <fabiorphp@gmail.com>
pkgname=php7-pecl-ast
_pkgreal=ast
pkgver=1.0.7
pkgrel=0
pkgdesc="PHP extension exposing PHP 7 abstract syntax tree - PECL"
url="https://pecl.php.net/package/ast"
arch="all"
license="BSD-3-Clause"
depends="php7-common"
makedepends="php7-dev"
source="$pkgname-$pkgver.tar.gz::https://pecl.php.net/get/$_pkgreal-$pkgver.tgz"
builddir="$srcdir"/$_pkgreal-$pkgver
provides="php7-ast=$pkgver-r$pkgrel" # for backward compatibility
replaces="php7-ast" # for backward compatibility

build() {
	phpize7
	./configure --prefix=/usr \
		--with-php-config=/usr/bin/php-config7
	make
}

check() {
	make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 test
}

package() {
	make INSTALL_ROOT="$pkgdir/" install
	install -d "$pkgdir"/etc/php7/conf.d
	echo "extension=$_pkgreal.so" > "$pkgdir"/etc/php7/conf.d/$_pkgreal.ini
}

sha512sums="9261764013c5d0e43a6e49381df97e3311157d344dc88ca2cc1aae058b1466308d496cbd5fb4d692aea959ea89d76729d921dbb40ab83335dee0ffd3a53b196a  php7-pecl-ast-1.0.7.tar.gz"
